package com.webbei.shoppingCar.dao.impl;

import org.apache.ibatis.session.SqlSession;

import com.webbei.pojo.Customer;
import com.webbei.pojo.Customs;
import com.webbei.pojo.Orders;
import com.webbei.shoppingCar.dao.shoppingCarDao;

public class shoppingCarDaoImpl implements shoppingCarDao{
	
	private SqlSession session;
	
	public SqlSession getSession() {
		return session;
	}

	public void setSession(SqlSession session) {
		this.session = session;
	}

	public Customer getCustomerByUserName(String userName) {
		return (Customer) (session.selectList("customer.getCustomerByUserName", userName).get(0));
	}

	public Customs getCustomsById(Integer customId) {
		return (Customs) (session.selectList("cust.getCustomsById", customId).get(0));
	}

	public Orders getOrdersById(Integer orderId) {
		return (Orders) (session.selectList("orders.getOrdersById", orderId).get(0));
	}

}
